package cn.wuxq.saa01helloworld.config;

import com.alibaba.cloud.ai.dashscope.api.DashScopeApi;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SaaLLMConfig {

//    @Value("${spring.ai.dashscope.api-key}")
//    private String apiKey;
//
//    @Bean
//    public DashScopeApi  dashscopeApi() {
//        System.out.println(apiKey);
//        return DashScopeApi.builder().apiKey(apiKey).build();
//    }

    @Bean
    public DashScopeApi  dashscopeApi() {
        return DashScopeApi.builder().apiKey(System.getenv("aliQwen-api")).build();
    }
}
